<template>
  <div id="nav-bar">
    <div class="nav-left" @click="handleBack">
      <slot name="left">
        <img class="arrow" src="@/assets/images/arrow-left-nav.png" alt />
      </slot>
    </div>
    <div class="nav-center">
      <slot name="center">标题</slot>
    </div>
    <div class="nav-right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "NavBar",
  props:{
    
  },
  methods:{
    handleBack(){
      this.$router.back(-1)
    }
  }
};
</script>

<style lang="scss" scoped>
#nav-bar {
  position: relative;
  z-index: 10;
  display: flex;
  height: 88px;
  line-height: 88px;
  text-align: center;
  padding: 0 40px;
  /*border-bottom: 1px solid #eee;*/
  /*box-shadow: 0 1px 1px rgba(100,100,100,.08);*/
}

.nav-left {
  .arrow {
    width: 16px;
    height: 32px;
    vertical-align: middle;
    display: inline-block;
  }
}

.nav-center {
  flex: 1;
  font-size: 34px;
  text-align: center;
}

.nav-right {
}
</style>
